/*
 * @Author: @yzcheng
 * @Date: 2021-03-19 14:52:25
 * @Version: 1.0
 * @LastEditors: @yzcheng
 * @Description: 
 * @LastEditTime: 2021-03-19 15:01:35
 */
import { copyTask, readTask } from '@/api/reading'

export default {
  namespaced: true,
  state: () => ({
    readingList: {},
    form: {},
  }),
  getter: {},
  actions: {
    // eslint-disable-next-line no-unused-vars
    async copyTask({ state }, payload) {
      let rst = await copyTask({
        size:500
      })
      rst = rst.data
      if (rst.success) {
        state.readingList = rst.data
      } else {
        return false
      }
    },
    // eslint-disable-next-line no-unused-vars
    async readTask({ state }, payload) {
      let rst = await readTask({ copyTaskId: payload })
      rst = rst.data
      if (rst.success) {
        state.form = rst?.data?.[0]
        console.log(state.form,'state.form');
      } else {
        return false
      }
    },
  },
  mutations: {},
}